import request from '@/utils/request'

// 获取月卡信息列表
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    method: 'GET',
    params
  })
}

// 新增月卡
export function addCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

// 获取编辑页月卡详情/parking/card/detail/{id}
export function getCardDetailAPI(id) {
  return request({
    url: '/parking/card/detail/' + id
  })
}

// 编辑月卡parking/card/edit
export function editCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}

// 删除月卡
export function delCardAPI(ids) {
  return request({
    url: '/parking/card/' + ids.join(','),
    method: 'DELETE'
  })
}

// 月卡续费/parking/card/recharge
export function rechargeCardAPI(data) {
  return request({
    url: '/parking/card/recharge',
    method: 'POST',
    data
  })
}

// 查看月卡详情parking/card/{Id}
export function getCardDetailByIdAPI(id) {
  return request({
    url: '/parking/card/' + id
  })
}
